package site.lanmushan.framework.mapper.api;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.UpdateProvider;
import org.springframework.context.annotation.Conditional;
import site.lanmushan.framework.mapper.annotation.ConditionalFalseHandler;
import site.lanmushan.framework.mapper.provider.DeleteWrapperMapperProvider;
import site.lanmushan.framework.mapper.wrapper.QueryWrapper;

/**
 * @author Administrator
 */
@Conditional(value = ConditionalFalseHandler.class)
public interface DeleteWrapperMapper<T> {


    /**
     * 根据Id逻辑删除
     *
     * @param id
     */
    @UpdateProvider(type = DeleteWrapperMapperProvider.class,
            method = "dynamicSQL")
    Integer logicDeleteByPrimaryKey(Long id);

    /**
     * 根据查询条件逻辑删除
     *
     * @param queryWrapper
     */
    @UpdateProvider(type = DeleteWrapperMapperProvider.class,
            method = "dynamicSQL")
    Integer logicDeleteQueryWrapper(@Param("query") QueryWrapper queryWrapper);
}
